{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "import lightgbm as lgbm\n",
    "from lightgbm.sklearn import LGBMClassifier\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [],
   "source": [
    "MAX_ROUNDS = 10000"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "train_lgb = pd.read_csv(\"train_lgb.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [],
   "source": [
    "test_lgb = pd.read_csv(\"test_lgb.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "outputs": [
    {
     "data": {
      "text/plain": "   click  user_id&media_id  user_id&C14_d  user_id&C17_d  user_id&C14_h  \\\n0     -1                 1              1              1              1   \n1     -1                 1              1              1              1   \n2     -1                 1              1              1              1   \n3     -1                 1              1              1              1   \n4     -1                 1              1              1              1   \n\n   user_id&C17_h  time  device_ip_c  user_id_c  \n0              1    -1        16875         18  \n1              1    -1            7          7  \n2              1    -1            2          2  \n3              1    -1            9          2  \n4              1    -1           31         31  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>click</th>\n      <th>user_id&amp;media_id</th>\n      <th>user_id&amp;C14_d</th>\n      <th>user_id&amp;C17_d</th>\n      <th>user_id&amp;C14_h</th>\n      <th>user_id&amp;C17_h</th>\n      <th>time</th>\n      <th>device_ip_c</th>\n      <th>user_id_c</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>-1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>16875</td>\n      <td>18</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>-1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>7</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>-1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>2</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>-1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>9</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>-1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>31</td>\n      <td>31</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 25
    }
   ],
   "source": [
    "train_lgb.head()\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [],
   "source": [
    "y_train = train_lgb['click']\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [],
   "source": [
    "X_train = train_lgb.drop(['click'],axis=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [],
   "source": [
    "X_test = test_lgb.drop(['click'],axis=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "   user_id&media_id  user_id&C14_d  user_id&C17_d  user_id&C14_h  \\\n0                 1              1              1              1   \n1                 1              1              1              1   \n2                 1              1              1              1   \n3                 1              1              1              1   \n4                 1              1              1              1   \n\n   user_id&C17_h  time  device_ip_c  user_id_c  \n0              1    -1        16875         18  \n1              1    -1            7          7  \n2              1    -1            2          2  \n3              1    -1            9          2  \n4              1    -1           31         31  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>user_id&amp;media_id</th>\n      <th>user_id&amp;C14_d</th>\n      <th>user_id&amp;C17_d</th>\n      <th>user_id&amp;C14_h</th>\n      <th>user_id&amp;C17_h</th>\n      <th>time</th>\n      <th>device_ip_c</th>\n      <th>user_id_c</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>16875</td>\n      <td>18</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>7</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>2</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>9</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>31</td>\n      <td>31</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 7
    }
   ],
   "source": [
    "X_train.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [],
   "source": [
    "#保存特征名字以备后用（可视化）\n",
    "feat_names = X_train.columns \n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [],
   "source": [
    "kfold = StratifiedKFold(n_splits=3, shuffle=True, random_state=3)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [],
   "source": [
    "def get_n_estimators(params , X_train , y_train , early_stopping_rounds=10):\n",
    "    lgbm_params = params.copy()\n",
    "    lgbm_params['num_class'] = 1\n",
    "     \n",
    "    lgbmtrain = lgbm.Dataset(X_train , y_train )\n",
    "     \n",
    "    #num_boost_round为弱分类器数目，下面的代码参数里因为已经设置了early_stopping_rounds\n",
    "    #即性能未提升的次数超过过早停止设置的数值，则停止训练\n",
    "    cv_result = lgbm.cv(lgbm_params , lgbmtrain , num_boost_round=MAX_ROUNDS , nfold=3,  metrics='auc' , early_stopping_rounds=early_stopping_rounds,seed=3 )\n",
    "     \n",
    "    print('best n_estimators:' , len(cv_result['auc-mean']))\n",
    "    print('best cv score:' , cv_result['auc-mean'][-1])\n",
    "     \n",
    "    return len(cv_result['auc-mean'])\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "outputs": [
    {
     "name": "stderr",
     "text": [
      "C:\\Anaconda3\\envs\\PY-Project\\lib\\site-packages\\lightgbm\\basic.py:794: UserWarning: categorical_feature keyword has been found in `params` and will be ignored.\n",
      "Please use categorical_feature argument of the Dataset constructor to pass this parameter.\n",
      "  .format(key))\n"
     ],
     "output_type": "stream"
    },
    {
     "name": "stdout",
     "text": [
      "best n_estimators: 388\n",
      "best cv score: 0.6166829675255124\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'num_leaves': 60,\n",
    "          'max_depth': 6,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          'subsample': 0.7,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'bagging_freq': 1,\n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "\n",
    "n_estimators_1 = get_n_estimators(params , X_train , y_train)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "Fitting 3 folds for each of 4 candidates, totalling 12 fits\n"
     ],
     "output_type": "stream"
    },
    {
     "name": "stderr",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done   8 out of  12 | elapsed:   51.3s remaining:   25.6s\n",
      "[Parallel(n_jobs=4)]: Done  12 out of  12 | elapsed:  1.3min finished\n"
     ],
     "output_type": "stream"
    },
    {
     "data": {
      "text/plain": "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=3, shuffle=True),\n             error_score=nan,\n             estimator=LGBMClassifier(boosting_type='gbdt',\n                                      categorical_feature=[0, 1, 2, 3, 4, 5, 6,\n                                                           7],\n                                      class_weight=None, colsample_bytree=0.7,\n                                      importance_type='split',\n                                      is_unbalance=True, learning_rate=0.1,\n                                      max_bin=255, max_depth=5,\n                                      min_child_samples=20,\n                                      min_child_weight=0.001,\n                                      min_split_gain=0.0, n_estimators=20,\n                                      n_jobs=4, num_leaves=31,\n                                      objective='binary', random_state=None,\n                                      reg_alpha=0.0, reg_lambda=0.0,\n                                      silent=False, subsample=1.0,\n                                      subsample_for_bin=200000,\n                                      subsample_freq=0),\n             iid='deprecated', n_jobs=4,\n             param_grid={'num_leaves': range(30, 40, 3)},\n             pre_dispatch='2*n_jobs', refit=False, return_train_score=False,\n             scoring='roc_auc', verbose=5)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 73
    }
   ],
   "source": [
    "#有问题阿，被忽略，类别特征这里被忽略有啥影响呢。。。。没精力去查阿\n",
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators': 20,\n",
    "          #'num_leaves': 60,\n",
    "          'max_depth': 5,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          'colsample_bytree': 0.7,\n",
    "          #'verbosity':5\n",
    "         }\n",
    "lg = LGBMClassifier(silent=False,  **params)\n",
    "num_leaves_s = range(30,40,3)\n",
    "tuned_parameters = dict(num_leaves = num_leaves_s)\n",
    "grid_search = GridSearchCV(lg,n_jobs=4,param_grid=tuned_parameters,cv=kfold,scoring=\"roc_auc\",verbose=5,refit=False)\n",
    "grid_search.fit(X_train,y_train)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "0.6059143723211285\n",
      "{'num_leaves': 33}\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "print(grid_search.best_score_)\n",
    "print(grid_search.best_params_)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAD4CAYAAAAHHSreAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxU9b3/8dcnCWEnARLWBMOSoICCGBYXkEVB22vt4rXgArhg1dqqrVzrvfd3l/7u/d22al16wYXFYl1Q27q0vbegFhQXliAgggZCWBKQnYSdbJ/fHzPYNCRhgCQnM3k/Hw8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iMhJFA4iInKS/w9K/VZUnYuHyAAAAABJRU5ErkJggg==\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid_search.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid_search.cv_results_[ 'std_test_score' ]\n",
    "#train_means = grid_search.cv_results_[ 'mean_train_score' ]\n",
    "#train_stds = grid_search.cv_results_[ 'std_train_score' ]\n",
    "n_leafs = len(num_leaves_s)\n",
    "\n",
    "x_axis = num_leaves_s\n",
    "\n",
    "plt.plot(x_axis, test_means)\n",
    "#plt.errorbar(x_axis, -test_scores, yerr=test_stds ,label = ' Test')\n",
    "#plt.errorbar(x_axis, -train_scores, yerr=train_stds,label =  +' Train')\n",
    "\n",
    "plt.show()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "Fitting 3 folds for each of 4 candidates, totalling 12 fits\n"
     ],
     "output_type": "stream"
    },
    {
     "name": "stderr",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done   8 out of  12 | elapsed:  9.7min remaining:  4.8min\n",
      "[Parallel(n_jobs=4)]: Done  12 out of  12 | elapsed: 14.2min finished\n"
     ],
     "output_type": "stream"
    },
    {
     "data": {
      "text/plain": "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=3, shuffle=True),\n             error_score=nan,\n             estimator=LGBMClassifier(boosting_type='gbdt',\n                                      categorical_feature=[0, 1, 2, 3, 4, 5, 6,\n                                                           7],\n                                      class_weight=None, colsample_bytree=0.7,\n                                      importance_type='split',\n                                      is_unbalance=True, learning_rate=0.1,\n                                      max_bin=255, max_depth=5,\n                                      min_child_samples=20,\n                                      min_child_weight=0.001,\n                                      min_split_gain=0.0, n_estimators=388,\n                                      n_jobs=4, num_leaves=27,\n                                      objective='binary', random_state=None,\n                                      reg_alpha=0.0, reg_lambda=0.0,\n                                      silent=False, subsample=1.0,\n                                      subsample_for_bin=200000,\n                                      subsample_freq=0),\n             iid='deprecated', n_jobs=4,\n             param_grid={'min_child_samples': range(10, 50, 10)},\n             pre_dispatch='2*n_jobs', refit=False, return_train_score=False,\n             scoring='roc_auc', verbose=5)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 44
    }
   ],
   "source": [
    "#有问题阿，被忽略，类别特征这里被忽略有啥影响呢。。。。没精力去查阿\n",
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators': n_estimators_1,\n",
    "          'num_leaves': 27,\n",
    "          'max_depth': 5,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          'colsample_bytree': 0.7,\n",
    "          #'verbosity':5\n",
    "         }\n",
    "lg = LGBMClassifier(silent=False,  **params)\n",
    "min_child_samples_s = range(10,50,10)\n",
    "tuned_parameters = dict(min_child_samples = min_child_samples_s)\n",
    "grid_search = GridSearchCV(lg,n_jobs=4,param_grid=tuned_parameters,cv=kfold,scoring=\"roc_auc\",verbose=5,refit=False)\n",
    "grid_search.fit(X_train,y_train)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "0.6201636459317963\n",
      "{'min_child_samples': 10}\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "print(grid_search.best_score_)\n",
    "print(grid_search.best_params_)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAR4ElEQVR4nO3df4xl513f8feH3WwARZEddhwF75o1MKsmjdyl3K4oW6o1rcMUqE3VYmyBcKTWBtFVqVTc2lWllEVIjVoKf3RVdTEhoaoxhrb2QNNuQmJSy+B07xbnx45ZsllDd9goO2zWCrSV7U2+/eOeLTfXd3bOrGc8cx+9X9LVzHnO9575Pnq8nzl+Zu7cVBWSpHZ91VY3IEnaXAa9JDXOoJekxhn0ktQ4g16SGrdzqxuYtHv37tq3b99WtyFJM+XUqVN/XFVz085tu6Dft28fw+Fwq9uQpJmS5A9XO+fWjSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNa5X0CdZSHImydkkD61Sc3eSpSSnkzw6Nv6lJM91j8WNalyS1M+afwIhyQ7gGHAHsAycTLJYVUtjNfPAw8Chqrqc5KaxS/zfqjqwwX1Lknrqc0d/EDhbVeeq6mXgMeCuiZr7gWNVdRmgqi5ubJuSpOvVJ+hvBs6PHS93Y+P2A/uTPJPk2SQLY+e+OsmwG/++aV8gyQNdzXBlZWVdE5AkXVufv16ZKWOT7yi+E5gHDgN7gKeTvLOqXgRuqaoLSb4R+GiST1XVZ7/iYlXHgeMAg8HAdyuXpA3U545+Gdg7drwHuDCl5smqeqWqXgDOMAp+qupC9/Ec8FvAt7zGniVJ69An6E8C80luTbILuAeY/O2ZJ4DbAZLsZrSVcy7JjUneODZ+CFhCkvS6WXPrpqquJDkCnAB2AO+rqtNJjgLDqlrszr0ryRLwJeDBqrqU5NuBf5fky4y+qfyL8d/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},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid_search.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid_search.cv_results_[ 'std_test_score' ]\n",
    "#train_means = grid_search.cv_results_[ 'mean_train_score' ]\n",
    "#train_stds = grid_search.cv_results_[ 'std_train_score' ]\n",
    "n_leafs = len(min_child_samples_s)\n",
    "\n",
    "x_axis = min_child_samples_s\n",
    "\n",
    "plt.plot(x_axis, test_means)\n",
    "#plt.errorbar(x_axis, -test_scores, yerr=test_stds ,label = ' Test')\n",
    "#plt.errorbar(x_axis, -train_scores, yerr=train_stds,label =  +' Train')\n",
    "\n",
    "plt.show()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "Fitting 3 folds for each of 3 candidates, totalling 9 fits\n"
     ],
     "output_type": "stream"
    },
    {
     "name": "stderr",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done   4 out of   9 | elapsed:   26.0s remaining:   32.5s\n",
      "[Parallel(n_jobs=4)]: Done   6 out of   9 | elapsed:   51.5s remaining:   25.7s\n",
      "[Parallel(n_jobs=4)]: Done   9 out of   9 | elapsed:  1.1min finished\n"
     ],
     "output_type": "stream"
    },
    {
     "data": {
      "text/plain": "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=3, shuffle=True),\n             error_score=nan,\n             estimator=LGBMClassifier(boosting_type='gbdt',\n                                      categorical_feature=[0, 1, 2, 3, 4, 5, 6,\n                                                           7],\n                                      class_weight=None, colsample_bytree=1.0,\n                                      importance_type='split',\n                                      is_unbalance=True, learning_rate=0.1,\n                                      max_bin=255, max_depth=5,\n                                      min_child_samples=20,\n                                      min_child_weight=0.001,\n                                      min_split_gain=0.0, n_estimators=20,\n                                      n_jobs=4, num_leaves=33,\n                                      objective='binary', random_state=None,\n                                      reg_alpha=0.0, reg_lambda=0.0,\n                                      silent=False, subsample=1.0,\n                                      subsample_for_bin=200000,\n                                      subsample_freq=0),\n             iid='deprecated', n_jobs=4,\n             param_grid={'colsample_bytree': [0.7, 0.8, 0.9]},\n             pre_dispatch='2*n_jobs', refit=False, return_train_score=False,\n             scoring='roc_auc', verbose=5)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 79
    }
   ],
   "source": [
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators': 20,\n",
    "          'num_leaves': 33,\n",
    "          'max_depth': 5,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          #'colsample_bytree': 0.7,\n",
    "          #'verbosity':5\n",
    "         }\n",
    "\n",
    "lg = LGBMClassifier(silent=False,  **params)\n",
    "colsample_bytree_s = [i/10.0 for i in range(7,10)]\n",
    "tuned_parameters = dict(colsample_bytree = colsample_bytree_s)\n",
    "grid_search = GridSearchCV(lg,n_jobs=4,param_grid=tuned_parameters,cv=kfold,scoring=\"roc_auc\",verbose=5,refit=False)\n",
    "grid_search.fit(X_train,y_train)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "outputs": [
    {
     "name": "stdout",
     "text": [
      "0.6063761141677002\n",
      "{'colsample_bytree': 0.9}\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "#0.5-0.9 0.5最佳，分数0.6202，现在是0.4最佳，看来是0.5\n",
    "print(grid_search.best_score_)\n",
    "print(grid_search.best_params_)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD4CAYAAADlwTGnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3dd3zV9dn/8ddFmGHvFcIMG1QMIOJA6sAtUutqnRU6uL3bX5WhWFEciFbbWlqLvV13tbYlgAgKbkVchFayIBDCCnvvQJJz/f5IvJumIIGM7xnv5+PBo+d8z+d8zvVpTr7vcz7n5NLcHRERiT01gi5ARESCoQAQEYlRCgARkRilABARiVEKABGRGFUz6AJORosWLbxTp05BlyEiElGWLl26w91blj0eUQHQqVMnUlNTgy5DRCSimNm6Yx3XFpCISIxSAIiIxCgFgIhIjFIAiIjEKAWAiEiMUgCIiMQoBYCISIxSAIiIhLGNew7z0JuZFBaFKn3uiPpDMBGRWBEKOa9+uY6pb68g5DDyjPb0T2hSqY+hABARCTO52w8wISWdr9bu4tykFjw2sh8dmsVX+uMoAEREwkRhUYjnF63hmfdWUrdmDZ78bn++e2YCZlYlj6cAEBEJA5mb9jI+JY2MjfsY0acND1/Th1YN61bpYyoAREQClF9QxLMfrOK5j3NpGl+bP9w8gEv7ta2Wx1YAiIgEZOm6XYybmcbq7QcZNSCBB67oRZP42tX2+AoAEZFqdvBIIU8uzOblz9fSrnE9Xr5jEOd3/492/VVOASAiUo0+WbmdibPS2bT3MLcO6cQ9l/SgQZ1gTsUKABGRarDn0FEemb+cmUvz6NKyPn8fM4TkTs0CrUkBICJSxd5O38wDb2Sy+9BRfnpBV/5reBJ1a8UFXZYCQESkqmzbn8+Db2TydsYW+rRrxMt3DKRPu8ZBl/V/FAAiIpXM3Zm5NI9H5i/ncEER40b04K5zu1ArLrzarykA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NKjv0bM/upma2m+P/Eu0/mvmGmIustbRTwT3c/UiVVVq5TXrOZ1QfGAw9VQ52VqSI/5+6Am9lCM/uHmY2r8morR0XWPBM4CGwG1gNPufuuqi23UpxwzWZ2BtDB3eed7H1PJBoCwI5x7D++2+ru0929K8Ung0knc98wU5H1Fk9g1gd4AhhTJRVWvoqs+SHgGXc/UIX1VYWKrLkmcA5wc8n/jjSz71RVoZWoImseBBQB7SjeDvmFmXWpqkIr0beu2cxqAM8AvzjZ+5ZHNARAHtCh1PUEYNNxxkLxW6xrTvG+4aAi68XMEoDZwC3uvrpKKqx8FVnzYGCama0FfgbcZ2Zjq6LISlbR5/XH7r7D3Q8BbwEDqqTKylWRNd9E8ecBBe6+DVgMREKvoBOtuSHFn9d9VPIcPguYW/JBcMXPX0F/CFIJH6LUpHh/tzP/+hClT5kxSaUuXwmkllzuw79/iJJLmH9YVsH1NikZPyrodVTXmsuMmUzkfAhckZ9zU+AfFH8YWhN4D7g86DVV8ZrHAy9S/Kq4PpAF9A96TZWx5jLjP+JfHwJX+PxV8zi5EDHcvbDkFd1Cij9Rf8HdM83sYYqfHHOBsWZ2IVAA7AZuLblvppn9jeInSyHwUw/zD8sqsl5gLNANeMDMHig5drEXv2IKWxVcc0Sq4PN6t5k9DSyheEvgLXefH8hCTkIFf87TKQ6ADIpD4EV3T6v2RZykcq75ePet8PlLrSBERGJUNHwGICIip0ABICISoxQAIiIxSgEgIhKjFAAiIjFKASAiEqMUACIiMer/AyQljp1dLo6uAAAAAElFTkSuQmCC\n"
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid_search.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid_search.cv_results_[ 'std_test_score' ]\n",
    "#train_means = grid_search.cv_results_[ 'mean_train_score' ]\n",
    "#train_stds = grid_search.cv_results_[ 'std_train_score' ]\n",
    "n_leafs = len(colsample_bytree_s)\n",
    "\n",
    "x_axis = colsample_bytree_s\n",
    "\n",
    "plt.plot(x_axis, test_means)\n",
    "#plt.errorbar(x_axis, -test_scores, yerr=test_stds ,label = ' Test')\n",
    "#plt.errorbar(x_axis, -train_scores, yerr=train_stds,label =  +' Train')\n",
    "\n",
    "plt.show()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "outputs": [
    {
     "name": "stderr",
     "text": [
      "C:\\Anaconda3\\envs\\PY-Project\\lib\\site-packages\\lightgbm\\basic.py:794: UserWarning: categorical_feature keyword has been found in `params` and will be ignored.\n",
      "Please use categorical_feature argument of the Dataset constructor to pass this parameter.\n",
      "  .format(key))\n"
     ],
     "output_type": "stream"
    },
    {
     "name": "stdout",
     "text": [
      "best n_estimators: 963\n",
      "best cv score: 0.623425034602808\n"
     ],
     "output_type": "stream"
    }
   ],
   "source": [
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'num_leaves': 27,\n",
    "          'max_depth': 5,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          'colsample_bytree': 1,\n",
    "          #'verbosity':5\n",
    "         }\n",
    "n_estimators_1 = get_n_estimators(params , X_train , y_train)\n",
    "#有毛用啊。。。。963个，有病啊"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "name": "stderr",
     "text": [
      "C:\\Anaconda3\\lib\\site-packages\\lightgbm\\basic.py:794: UserWarning: categorical_feature keyword has been found in `params` and will be ignored.\n",
      "Please use categorical_feature argument of the Dataset constructor to pass this parameter.\n",
      "  .format(key))\n"
     ],
     "output_type": "stream"
    },
    {
     "data": {
      "text/plain": "LGBMClassifier(boosting_type='gbdt',\n               categorical_feature=[0, 1, 2, 3, 4, 5, 6, 7], class_weight=None,\n               colsample_bytree=1, importance_type='split', is_unbalance=True,\n               learning_rate=0.1, max_bin=255, max_depth=5,\n               min_child_samples=20, min_child_weight=0.001, min_split_gain=0.0,\n               n_estimators=20, n_jobs=4, num_leaves=33, objective='binary',\n               random_state=None, reg_alpha=0.0, reg_lambda=0.0, silent=False,\n               subsample=1.0, subsample_for_bin=200000, subsample_freq=0,\n               verbosity=5)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 10
    }
   ],
   "source": [
    "params = {'boosting_type': 'gbdt',\n",
    "          'objective': 'binary',\n",
    "          'is_unbalance':True,\n",
    "          'categorical_feature':[0,1,2,3,4,5,6,7],\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'num_leaves': 33,\n",
    "          'max_depth': 5,\n",
    "          'n_estimators':20,\n",
    "          'max_bin': 255, #2^6,原始特征为整数，很少超过100\n",
    "          'colsample_bytree': 1,\n",
    "          'verbosity':5\n",
    "         }\n",
    "lg = LGBMClassifier(silent=False, **params)\n",
    "lg.fit(X_train,y_train)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "outputs": [],
   "source": [
    "new_feature=lg.predict(X_train,pred_leaf=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [],
   "source": [
    "new_feature_test = lg.predict(X_test,pred_leaf=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "outputs": [
    {
     "data": {
      "text/plain": "array([[12, 11, 12, ...,  7, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       ...,\n       [12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8]])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 84
    }
   ],
   "source": [
    "new_feature"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "data": {
      "text/plain": "array([[12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       ...,\n       [12, 11, 12, ...,  8, 11,  8],\n       [12, 11, 12, ...,  8, 11,  8],\n       [ 8,  9,  7, ...,  5,  5,  9]])"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 14
    }
   ],
   "source": [
    "new_feature_test"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "outputs": [],
   "source": [
    "pdf = pd.DataFrame(new_feature)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [],
   "source": [
    "pdf_test = pd.DataFrame(new_feature_test)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "outputs": [
    {
     "data": {
      "text/plain": "    0   1   2   3  4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  \\\n0  12  11  12  13  9  10  13  11  15  13  13  14  12  13   8   8  12   7  11   \n1  12  11  12  13  9  10  13  12  15  13  13  14  12  12   8   8  12   8  11   \n2  12  11  12  13  8  10  13  11  15  13  16  14  12  13   8   8  12   8  11   \n3  12  11  12  13  8  10  13  10  15  13  16  14  12  13   8   8  12   8  11   \n4  12  11  12  13  9  10  13  11  15  13  13  14  12  13   8   8  12   8  11   \n\n   19  \n0   8  \n1   8  \n2   8  \n3   8  \n4   8  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n      <th>1</th>\n      <th>2</th>\n      <th>3</th>\n      <th>4</th>\n      <th>5</th>\n      <th>6</th>\n      <th>7</th>\n      <th>8</th>\n      <th>9</th>\n      <th>10</th>\n      <th>11</th>\n      <th>12</th>\n      <th>13</th>\n      <th>14</th>\n      <th>15</th>\n      <th>16</th>\n      <th>17</th>\n      <th>18</th>\n      <th>19</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>7</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>12</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>12</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>10</td>\n      <td>13</td>\n      <td>10</td>\n      <td>15</td>\n      <td>13</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 86
    }
   ],
   "source": [
    "pdf.head()\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "outputs": [],
   "source": [
    "pstr = []\n",
    "for i in range(30,50):\n",
    "    pstr.append(\"C\"+str(i))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [],
   "source": [
    "pstr_test = []\n",
    "for i in range(30,50):\n",
    "    pstr_test.append(\"C\"+str(i))"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "outputs": [
    {
     "data": {
      "text/plain": "['C30',\n 'C31',\n 'C32',\n 'C33',\n 'C34',\n 'C35',\n 'C36',\n 'C37',\n 'C38',\n 'C39',\n 'C40',\n 'C41',\n 'C42',\n 'C43',\n 'C44',\n 'C45',\n 'C46',\n 'C47',\n 'C48',\n 'C49']"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 96
    }
   ],
   "source": [
    "pstr"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "outputs": [],
   "source": [
    "pdf.columns = pstr"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "outputs": [],
   "source": [
    "pdf_test.columns = pstr_test"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "outputs": [
    {
     "data": {
      "text/plain": "   C30  C31  C32  C33  C34  C35  C36  C37  C38  C39  C40  C41  C42  C43  C44  \\\n0   12   11   12   13    9   10   13   11   15   13   13   14   12   13    8   \n1   12   11   12   13    9   10   13   12   15   13   13   14   12   12    8   \n2   12   11   12   13    8   10   13   11   15   13   16   14   12   13    8   \n3   12   11   12   13    8   10   13   10   15   13   16   14   12   13    8   \n4   12   11   12   13    9   10   13   11   15   13   13   14   12   13    8   \n\n   C45  C46  C47  C48  C49  \n0    8   12    7   11    8  \n1    8   12    8   11    8  \n2    8   12    8   11    8  \n3    8   12    8   11    8  \n4    8   12    8   11    8  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>C30</th>\n      <th>C31</th>\n      <th>C32</th>\n      <th>C33</th>\n      <th>C34</th>\n      <th>C35</th>\n      <th>C36</th>\n      <th>C37</th>\n      <th>C38</th>\n      <th>C39</th>\n      <th>C40</th>\n      <th>C41</th>\n      <th>C42</th>\n      <th>C43</th>\n      <th>C44</th>\n      <th>C45</th>\n      <th>C46</th>\n      <th>C47</th>\n      <th>C48</th>\n      <th>C49</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>7</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>12</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>12</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>10</td>\n      <td>13</td>\n      <td>10</td>\n      <td>15</td>\n      <td>13</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 98
    }
   ],
   "source": [
    "pdf.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "outputs": [
    {
     "data": {
      "text/plain": "   C30  C31  C32  C33  C34  C35  C36  C37  C38  C39  C40  C41  C42  C43  C44  \\\n0   12   11   12   13    9   10   13   10   15   13   13   14   12   13    8   \n1   12   11   12   13    9   10   13   11   15   13   13   14   12   13    8   \n2   12   11   12   13    9   10   13   11   15   13   13   14   12   13    8   \n3   12   11   12   13    9   10   13   12   15   13   13   14   12   12    8   \n4   12   11   12   13    8   10   13   11   15   13   16   14   12   13    8   \n\n   C45  C46  C47  C48  C49  \n0    8   12    8   11    8  \n1    8   12    8   11    8  \n2    8   12    8   11    8  \n3    8   12    8   11    8  \n4    8   12    8   11    8  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>C30</th>\n      <th>C31</th>\n      <th>C32</th>\n      <th>C33</th>\n      <th>C34</th>\n      <th>C35</th>\n      <th>C36</th>\n      <th>C37</th>\n      <th>C38</th>\n      <th>C39</th>\n      <th>C40</th>\n      <th>C41</th>\n      <th>C42</th>\n      <th>C43</th>\n      <th>C44</th>\n      <th>C45</th>\n      <th>C46</th>\n      <th>C47</th>\n      <th>C48</th>\n      <th>C49</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>10</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>9</td>\n      <td>10</td>\n      <td>13</td>\n      <td>12</td>\n      <td>15</td>\n      <td>13</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>12</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>12</td>\n      <td>11</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>10</td>\n      <td>13</td>\n      <td>11</td>\n      <td>15</td>\n      <td>13</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 18
    }
   ],
   "source": [
    "pdf_test.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "outputs": [],
   "source": [
    "pdf.to_csv(\"train_gbdtappend.csv\",index=False)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [],
   "source": [
    "pdf_test.to_csv(\"test_gbdtappend.csv\",index=False)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}